



import 'package:flutter/material.dart';
import 'package:get/get.dart';


final ThemeData darkTheme = ThemeData(  
  brightness: Brightness.dark,  
  primarySwatch: Colors.blue,  
  // 其他配置...  
);  
 
final ThemeData lightTheme = ThemeData(  
  brightness: Brightness.light,  
  primarySwatch: Colors.green,  
  // 其他配置...  
);

class MyThemeController extends GetxController {  
  Rx<ThemeData> currentTheme = darkTheme.obs; // 默认是暗色主题  
 
  void changeTheme() {  
    currentTheme.value = currentTheme.value == darkTheme ? lightTheme : darkTheme;  
    update(); // 通知界面更新  
  }  
}
